#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtdeclarative_auto)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtdeclarative)
#设置需要链接的模块
set(LinkQt Core Qml Quick Concurrent Gui Network QuickControls2 QmlWorkerScript QuickTemplates2 QuickWidgets Sql Widgets OpenGL)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core Qml Quick Gui Network QuickWidgets Widgets)

add_definitions(-DQT_QMLTEST_DATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/data\")
add_definitions(-DTEST_QTBUG_60123)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
add_definitions(-DSRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}\")

set(CodeRootPath ${ISSQTTESTROOTDIR}/qtdeclarative)
include_directories(${CodeRootPath}/tests/auto/shared)

#多级目录
set(TEST_ITEMS ${TEST_ITEMS}
   qml/qjsvalueiterator
   qml/qjsonbinding
   qml/qqmlfile
   qml/qqmlfileselector
   qml/qmlmin
   qml/qqmlconsole
   qml/qqmlerror
   qml/qqmlinfo
   qml/qqmllistreference
   qml/qqmllocale
   qml/qqmlmetaobject
   qml/qqmlpromise
   qml/qtqmlmodules
   qml/qquickfolderlistmodel
   qml/qqmlsettings
   qml/qqmlstatemachine
   qml/qmldiskcache
   qml/qjsengine
   qml/qjsvalue
   qmltest
   quick/drawingmodes
   quick/geometry
   quick/qquickpixmapcache
   quicktest/signalspy
   quicktest/testfiltering
   quickwidget
   quick/shared
   shared
#  注意qmldevtools/compile不会生成xmlNothing - this test just makes sure that the QmlDevTools headers are present, and that we can link against the library.
#   qmldevtools/compile
   qml/qqmlengine
   qml/qqmlcomponent
   quick/nodes
   qml/parserstress
   qml/qqmlincubator
   qml/qqmlnotifier
   qml/qqmlqt
   qml/qqmlxmlhttprequest
   qml/qqmlapplicationengine
)

#排出不需要的.cpp
set(EXCLUDE_SRC ${EXCLUDE_SRC}
    qml/qqmlengine/tst_qqmlengine.cpp                              #not ssl
    quicktest/testfiltering/tst_testfiltering.cpp                 #not support QProcess
    quick/drawingmodes/tst_drawingmodes.cpp                        #(SIGABRT(SI_TKILL))(ASSERT: "context" in file E:/GitResp/qt5/qtbase/src/gui/opengl/qopenglfunctions.cpp)
    qml/qqmlqt/tst_qqmlqt.cpp                                 #SIGSEGV(SEGV_MAPERR)(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::operator->() const)
)

#设置依赖的插件
set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin QQmlDebuggerServiceFactory QQmlInspectorServiceFactory QLocalClientConnectionFactory QDebugMessageServiceFactory
QQmlNativeDebugConnectorFactory QQmlNativeDebugServiceFactory QQmlPreviewServiceFactory QQmlProfilerServiceFactory QQuickProfilerAdapterFactory QQmlDebugServerFactory
QTcpServerConnectionFactory)

create_library(${TEST_ITEMS})